static guint focus_notify_handler = 0;
static guint focus_tracker_id = 0;
static GQuark quark_focus_object = 0;
+static int initialized = FALSE;
static AtkObject*
gail_get_accessible_for_widget (GtkWidget *widget,
}
}
+void
+_gtk_accessibility_shutdown (void)
+{
+ if (!initialized)
+ return;
+
+ initialized = FALSE;
+
+ g_clear_object (&atk_misc_instance);
+
+#ifdef GDK_WINDOWING_X11
+ atk_bridge_adaptor_cleanup ();
+#endif
+ _gail_util_uninstall ();
+}
+
void
_gtk_accessibility_init (void)
{
- static int initialized = FALSE;
if (initialized)
return;
(GCallback) window_removed, NULL);
}
+static void
+undo_window_event_initialization (void)
+{
+ AtkObject *root;
+
+ root = atk_get_root ();
+
+ g_signal_handlers_disconnect_by_func (root, (GCallback) window_added, NULL);
+ g_signal_handlers_disconnect_by_func (root, (GCallback) window_removed, NULL);
+}
+
static AtkKeyEventStruct *
atk_key_event_from_gdk_event_key (GdkEventKey *key)
{
return GTK_VERSION;
}
+void
+_gail_util_uninstall (void)
+{
+ undo_window_event_initialization ();
+}
+
void
_gail_util_install (void)
{
G_BEGIN_DECLS
void _gail_util_install (void);
+void _gail_util_uninstall (void);
gboolean _gail_util_key_snooper (GtkWidget *the_widget,
GdkEventKey *event);
#include <gdk/x11/gdkx.h>
#endif
+extern void _gtk_accessibility_shutdown (void);
+
/**
* SECTION:gtkapplication
* @title: GtkApplication
gtk_application_shutdown_quartz (GTK_APPLICATION (application));
#endif
+ /* Keep this section in sync with gtk_main() */
+
/* Try storing all clipboard data we have */
_gtk_clipboard_store_all ();
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
+ _gtk_accessibility_shutdown ();
+
G_APPLICATION_CLASS (gtk_application_parent_class)
->shutdown (application);
}
/* XXX: Remove me after getting rid of gail */
extern void _gtk_accessibility_init (void);
+extern void _gtk_accessibility_shutdown (void);
static void
do_post_parse_initialization (int *argc,
if (gtk_main_loop_level == 0)
{
+ /* Keep this section in sync with gtk_application_shutdown() */
+
/* Try storing all clipboard data we have */
_gtk_clipboard_store_all ();
/* Synchronize the recent manager singleton */
_gtk_recent_manager_sync ();
+
+ _gtk_accessibility_shutdown ();
}
}